Error when creating trigger

I have the following statement to create a trigger :

Trigger t
string NameTrig = "Toto"
t = trigger(NameTrig,project->"Proto"->module->"SRD"->object->all->attribute->"Components",post,save,5,"#include <updateFBColumn.dxl>")
I get the following error message on the t=trigger ... line :
invalid module specification

I have verified that the project, module and attribute names are correct. So, what is wrong ??

Any hint appreciated...
sdauphin - Thu Sep 09 11:08:33 EDT 2010

Re: Error when creating trigger
Mathias Mamsch - Tue Sep 21 02:52:50 EDT 2010

Try setting your SRD module to be the current module and do:
 

t = trigger(NameTrig,attribute->"Components",post,save,5,"#include <updateFBColumn.dxl>")

 


This should do the trick. I think you cannot line up all these project->"..."->module"..." statements. Just use the current Project or Module for that.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Error when creating trigger
llandale - Tue Sep 21 10:07:20 EDT 2010

Mathias is right, triggers that are intended for a single module should be stored in that module. Open SRD edit, run Mathias code, then save the module.

I'm unsure exactly where such a trigger would be stored; but supposing your code will cause it to be stored in the Project: Even if there is only one module named "SRD" in that Project, you will still have to tell your Trigger where to find it. Try "/Proto/SRD" or "/Proto/SubFolder/SRD".

Understand that when the Trigger fires, it will issue that #include statement. Everybody will have to have access to that in their DOORS Addins path in order for it to work, which is unlikely.

Consider the following instead:

string DxlCode = readFile("c:/MyFolder/MyOtherFolder/updateFBColumn.dxl")
if (null DxlCode) no such file; halt
string ErrMess = checkDXL(DxlCode)
if (!null ErrMess) deal with interpret errors; halt
 
if (confirm("Remove trigger?" NameTrig "??"))
   delete(NameTrig, project->"Proto"->module->"/Proto/SRD"->object->all->attribute->"Components",post,save,5)
 
if (confirm("Deploy Trigger " NameTrig "??"))
   t = trigger(NameTrig,project->"Proto"->module->"/Proto/SRD"->object->all->attribute->"Components",post,save,5,DxlCode)
 
if (null t) deal with trigger not deployed.

 

 

  • Louie